package handler
import (
	"context"
	"gitee.com/www.fei.com/cart/domain/model"
	"gitee.com/www.fei.com/cart/domain/service"
	cart "gitee.com/www.fei.com/cart/proto/cart"
	comm "gitee.com/www.fei.com/go_common"
	log "github.com/micro/go-micro/v2/logger"
)
type Cart struct{
     CartDataService service.ICartDataService
}



func (c *Cart)AddCart(ctx context.Context, form *cart.CartForm, res *cart.Response) (err error) {
	car :=&model.Cart{}
	comm.SwapTo(form,car)
	cardId, err := c.CartDataService.AddCart(car)
	res.Code=200
	res.Message="success cartId:"+ string(cardId)
	log.Debug(res)
	return nil
}
